package com.ccz.demo.design.proxy.demo1.cglibproxy;

import net.sf.cglib.proxy.Enhancer;

/**
 * @ClassName ProxyFactory
 * @Author caihaoyun
 * @Date 2020/4/13
 * @Version V1.0
 **/
public class ProxyFactory {

    public static Object getGcLibDynamicProxy(Object target) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(new cgLibDynProxyLawyer());
        Object o = enhancer.create();
        return o;
    }

}
